<!DOCTYPE html>
<html>
<head>

<style> 

table, td, th
{
    border:1px solid black;
}
.first 
{
    background-color:#9400D3;
    color:black;
}
.second
{
    background-color:#5c9eec;
    color:white;
}
</style> 
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<script>
	document.write('<br/>');
	document.write('<table border="1" align="center">');
	for (var i=1;i<=9;i++) {
		if(i%2==0) {
			document.write('<tr class="first">');
		} else {
			document.write('<tr class="second">');
		}
		for (var j=1;j<=i;j++) {
			document.write('<td>');
			document.write(j+'*'+i+'='+i*j+'&nbsp');
			document.write('</td>');
		}
		document.write('</tr>');
		document.write('<br/>');
	}
	document.write('</table>');
</script>
</body>
</html>